import request from '@/utils/request'

// 查询备件退库列表
export function listReturn(query) {
  return request({
    url: '/wms/returnn/list', method: 'get', params: query
  })
}

// 查询备件退库详细
export function getReturn(id) {
  return request({
    url: '/wms/returnn/' + id, method: 'get'
  })
}

// 新增备件退库
export function addReturn(data) {
  return request({
    url: '/wms/returnn', method: 'post', data: data
  })
}

// 修改备件退库
export function updateReturn(data) {
  return request({
    url: '/wms/returnn', method: 'put', data: data
  })
}

// 删除备件退库
export function delReturn(id) {
  return request({
    url: '/wms/returnn/' + id, method: 'delete'
  })
}

/**
 * @description 备件退库申请
 * @param {} ids 
 */
export function part_return(ids){
  return request({
    url: '/wms/returnn/part_return/',
    method: 'post',
    data:ids,
  })
}

/**
 * @description 一级审批，完成退库
 * @param {*} id 
 * @returns 
 */
export function part_return_approval1(id) {
  return request({
    url: '/wms/returnn/part_return_approval1/'  + id,
    method: 'get',
  })
}

/**
 * @description 二级审批，完成退库
 * @param {*} id 
 * @returns 
 */
export function part_return_approval2(id) {
  return request({
    url: '/wms/returnn/part_return_approval2/'  + id,
    method: 'get',
  })
}

